<?php
session_start();
if (!isset($_SESSION['username'])) {
    header('Location: login.php');
    exit();
}
require_once 'track_online.php';
$currentUser = $_SESSION['username'];
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的 - JIILCHAT</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #3498db;
            --primary-dark: #2980b9;
            --accent: #e74c3c;
            --light: #f8f9fa;
            --dark: #343a40;
            --gray: #6c757d;
            --success: #2ecc71;
            --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
            color: var(--dark);
            min-height: 100vh;
            overflow-x: hidden;
        }
        
        /* 纯白色顶部设计 */
        .header {
            background-color: #FFFFFF; /* 纯白色背景 */
            padding: 20px;
            display: flex;
            align-items: center;
            box-shadow: var(--shadow);
            position: relative;
            z-index: 10;
        }
        
        .header a {
            color: #333; /* 深色文字 */
            text-decoration: none;
            font-size: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition);
        }
        
        .header a:hover {
            transform: translateX(-5px);
            color: var(--primary); /* 悬停时使用主色 */
        }
        
        .header h1 {
            margin: 0 auto;
            font-size: 22px;
            font-weight: 600;
            letter-spacing: 1px;
            color: #000; /* 黑色标题 */
        }
        
        /* 内容容器 */
        .container {
            padding: 30px 20px 100px;
            max-width: 600px;
            margin: 0 auto;
        }
        
        /* 用户信息卡片 */
        .user-card {
            background: white;
            border-radius: 20px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: var(--shadow);
            text-align: center;
            position: relative;
            overflow: hidden;
            transition: var(--transition);
            transform: translateY(0);
            animation: float 4s ease-in-out infinite;
        }
        
        .user-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
        }
        
        .user-card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: linear-gradient(90deg, var(--primary), var(--accent));
            animation: gradient 3s ease infinite;
            background-size: 200% 200%;
        }
        
        .user-icon {
            width: 100px;
            height: 100px;
            background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
            border-radius: 50%;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 40px;
            box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
        }
        
        .user-info h2 {
            margin: 0 0 10px;
            font-size: 28px;
            font-weight: 700;
            color: var(--dark);
        }
        
        .welcome-text {
            font-size: 18px;
            font-weight: 700;
            margin: 20px 0;
            color: var(--primary);
            position: relative;
            display: inline-block;
            animation: pulse 2s infinite;
        }
        
        .version-badge {
            display: inline-block;
            background: linear-gradient(135deg, #2ecc71, #27ae60);
            color: white;
            padding: 6px 15px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 600;
            box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
        }
        
        /* 操作按钮 */
        .actions {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .action-btn {
            background: white;
            border: none;
            padding: 18px;
            font-size: 18px;
            border-radius: 15px;
            cursor: pointer;
            text-align: left;
            box-shadow: var(--shadow);
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 15px;
            position: relative;
            overflow: hidden;
        }
        
        .action-btn::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 5px;
            height: 100%;
            background: var(--primary);
            transition: var(--transition);
        }
        
        .action-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        }
        
        .action-btn:hover::before {
            width: 100%;
            opacity: 0.1;
        }
        
        .action-btn i {
            font-size: 24px;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            color: white;
        }
        
        .btn-update i { background: linear-gradient(135deg, #3498db, #2980b9); }
        .btn-website i { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
        .btn-group i { background: linear-gradient(135deg, #e74c3c, #c0392b); }
        
        .btn-text {
            flex-grow: 1;
            z-index: 1;
        }
        
        .btn-text span {
            display: block;
            font-size: 16px;
            color: var(--gray);
            font-weight: 500;
        }
        
        /* 页脚设计 */
        .footer {
            position: fixed;
            bottom: 0;
            width: 100%;
            background: white;
            color: var(--gray);
            text-align: center;
            padding: 15px;
            font-size: 14px;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
            z-index: 5;
        }
        
        /* 弹窗设计 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            justify-content: center;
            align-items: center;
            z-index: 1000;
            backdrop-filter: blur(5px);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .modal.active {
            display: flex;
            opacity: 1;
        }
        
        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
            text-align: center;
            width: 90%;
            max-width: 400px;
            transform: scale(0.9);
            opacity: 0;
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        }
        
        .modal.active .modal-content {
            transform: scale(1);
            opacity: 1;
        }
        
        .modal-icon {
            font-size: 60px;
            color: var(--primary);
            margin-bottom: 20px;
            animation: bounce 2s infinite;
        }
        
        .modal-content p {
            font-size: 18px;
            margin-bottom: 25px;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
        }
        
        .modal-btn {
            padding: 12px 25px;
            font-size: 16px;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: var(--transition);
            font-weight: 600;
        }
        
        .btn-confirm {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
        }
        
        .btn-cancel {
            background: white;
            color: var(--gray);
            border: 1px solid #e0e0e0;
        }
        
        .modal-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        /* 动画效果 */
        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }
        
        @keyframes gradient {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); color: var(--primary); }
            50% { transform: scale(1.05); color: var(--accent); }
        }
        
        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-20px); }
            60% { transform: translateY(-10px); }
        }
        
        /* 响应式设计 */
        @media (max-width: 480px) {
            .user-card {
                padding: 25px 20px;
            }
            
            .user-icon {
                width: 80px;
                height: 80px;
                font-size: 32px;
            }
            
            .action-btn {
                padding: 15px;
                font-size: 16px;
            }
        }
    </style>
</head>
<body>
    <!-- 纯白色顶部设计 -->
    <div class="header">
        <a href="profile.php"><i class="fas fa-arrow-left"></i> 返回</a>
        <h1>关于</h1>
    </div>
    
    <div class="container">
        <div class="user-card">
            <div class="user-icon">
                <i class="fas fa-user"></i>
            </div>
            <div class="user-info">
                <h2><?= htmlspecialchars($currentUser) ?></h2>
                <div class="welcome-text">欢迎来到 JIILCHAT 微聊</div>
                <div class="version-badge">版本号: 4.0 全新版本</div>
            </div>
        </div>
        
        <div class="actions">
            <button class="action-btn btn-update" onclick="showModal('update-modal')">
                <i class="fas fa-sync-alt"></i>
                <div class="btn-text">
                    <strong>版本更新</strong>
                    <span>获取最新功能和优化</span>
                </div>
                <i class="fas fa-chevron-right"></i>
            </button>
            
            <button class="action-btn btn-website" onclick="window.open('http://all.jiil.top:65093')">
                <i class="fas fa-globe"></i>
                <div class="btn-text">
                    <strong>打开官网</strong>
                    <span>访问JIILCHAT官方网站</span>
                </div>
                <i class="fas fa-chevron-right"></i>
            </button>
            
            <button class="action-btn btn-group" onclick="window.open('https://qm.qq.com/q/eov5oY2DKg')">
                <i class="fas fa-users"></i>
                <div class="btn-text">
                    <strong>加入交流群</strong>
                    <span>与用户和开发者交流</span>
                </div>
                <i class="fas fa-chevron-right"></i>
            </button>
        </div>
    </div>
    


    <!-- 版本更新弹窗 -->
    <div class="modal" id="update-modal">
        <div class="modal-content">
            <div class="modal-icon">
                <i class="fas fa-sync-alt"></i>
            </div>
            <p>更新请加好友 JIIL 获取最新版本信息</p>
            <div class="modal-buttons">
                <button class="modal-btn btn-confirm" onclick="closeModal('update-modal')">确定</button>
                <button class="modal-btn btn-cancel" onclick="closeModal('update-modal')">关闭</button>
            </div>
        </div>
    </div>
    
    <script>
        function showModal(modalId) {
            document.getElementById(modalId).classList.add('active');
        }
        
        function closeModal(modalId) {
            document.getElementById(modalId).classList.remove('active');
        }
        
        // 页面加载动画
        document.addEventListener('DOMContentLoaded', function() {
            document.body.style.opacity = 1;
        });
    </script>
</body>
</html>